package top.du1888.ai.advice;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice //控制器增强器
public class ExceptionControllerAdvice {
    @ExceptionHandler(RuntimeException.class) //处理什么类型的异常
    public String handlException(RuntimeException e, Model model) {
        return "errorView"; //错误页面视图名称
    }
}
